<?php

use App\Http\Controllers\admin\UserController;
use App\Http\Controllers\IndexController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
//    return redirect("https://www.apifox.cn/apidoc/shared-fc195f14-5f1e-4807-9ef4-c872c05c16d4");
    return view('welcome');
});

Route::get('/index/{id}',[IndexController::class,'index'])->name('index');

//路由群组
Route::prefix('manager')->group(function (){
//    Route::middleware([\App\Http\Middleware\EnsureTokenIsValid::class])->get("login",[IndexController::class,'login']);
//    全局注册之后这样使用
//    Route::get("login",[IndexController::class,'login'])->middleware(['TokenValid']);
//    Route::post('register',[IndexController::class,'register'])->name('register');
//
//    Route::post('login',[IndexController::class,'login'])->name('login');
//
//    Route::get('login',[IndexController::class,'login']);
//
//    Route::get('getUserMessage',[IndexController::class,'getUserMessage']);
//
//    Route::put('changeUser',[IndexController::class,'changeUser']);
//
//    Route::delete('delete',[IndexController::class,'delete']);
    Route::post("send",[IndexController::class,'send']);
});

